package com.example;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/6/6
 */
public class GameScene {
    private String sceneState;  // 游戏场景状态

    public void setSceneState(String state) {
        this.sceneState = state;
    }

    public String getSceneState() {
        return sceneState;
    }

    // 创建备忘录，保存当前状态
    public Memento save() {
        return new Memento(sceneState);
    }

    // 从备忘录恢复状态
    public void restore(Memento memento) {
        this.sceneState = memento.getState();
    }

    @Override
    public String toString() {
        return "当前游戏场景: " + sceneState;
    }
}
